

package com.qiyu.mq.core.consumer;

import org.apache.rocketmq.client.hook.ConsumeMessageContext;
import org.apache.rocketmq.client.hook.ConsumeMessageHook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author  idea
 * @version V1.0
 * @date 2020/8/10
 */
@Component
public class DefaultConsumerHook implements ConsumeMessageHook {

    public static final Logger LOGGER = LoggerFactory.getLogger(DefaultConsumerHook.class);

    @Override
    public String hookName() {
        return DefaultConsumerHook.class.getName();
    }

    @Override
    public void consumeMessageBefore(ConsumeMessageContext consumeMessageContext) {
        LOGGER.info("execute consumeMessageBefore ,consumeMessageBefore is :{}",consumeMessageContext);
    }

    @Override
    public void consumeMessageAfter(ConsumeMessageContext consumeMessageContext) {
        LOGGER.info("execute consumeMessageAfter ,consumeMessageAfter is :{}",consumeMessageContext);
    }
}
